﻿<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>表单</title>
<link rel="stylesheet" type="text/css" href="<s:property value="staticsRoot"/>/css/style.css"/>
<script type="text/javascript" src="<s:property value="staticsRoot"/>/js/jquery-1.8.3.min.js"></script>
<script>document.domain="7k7k.com";</script>
<script type="text/javascript" charset="utf-8" src="<s:property value="staticsRoot"/>/js/kindeditor.js"></script>
<script type="text/javascript" charset="utf-8" src="<s:property value="staticsRoot"/>/js/lang/zh_CN.js"></script>
<script type="text/javascript">
var editor;
KindEditor.ready(function(K) {
	editor = K.create('textarea[id="content"]', {
		allowFileManager : false,
		uploadJson : '../upload.html',
		filePostName : 'filedata',
		urlType : 'domain',
		items : [
		'source', 'undo', 'redo', 'preview', '|', 
		'justifyleft', 'justifycenter', 'justifyright', 'justifyfull', 'clearhtml', 'quickformat', '|',		 
		'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline', 'strikethrough', 'removeformat', '|', 
		'image', 'insertfile', 'table', 'hr', 'emoticons', 'anchor', 'link', 'unlink','flash','media', '|', 
		'about' 
		]
	});
});
</script>
</head>
<body>
<div class="right">
	<h3 class="title box">
    	当前位置：k吧后台管理&nbsp;&gt;&gt;&nbsp;吧管理&nbsp;&gt;&gt;&nbsp编辑吧CMS;
    </h3>    
    <form id="updateForm" name="updateForm" action="updateBarCms.html" method="post">
       <input type="hidden" name="barCmsDO.barId" value="<s:property value="barCmsDO.barId"/>"/>
       <ul class="mess">
       		<li>
       			<span style="color:#ffffff;font-weight:bold;">吧名称：<s:property value="barDO.name"/></span>
       		</li>
            <li class="special">
              <textarea id="content" name="barCmsDO.content" maxlength="65534" style="width:800px;height:400px;visibility:hidden;"><s:property value="barCmsDO.content" escape="false"/></textarea>
              <br/>
              <span id="contentErr" class="red"></span>
          	</li>
            <li>
            	<br/>
            	<div class="lit_btn">
                   	<a href="#" onclick="doSubmit()">提&nbsp;交</a>
                </div>
            </li>
        </ul>
	</form>
</div>
<script type="text/javascript">
	//验证发贴
	function doSubmit(){
		$("#contentErr").html("");
		//验证内容
		if(editor.html() == ""){
			$("#contentErr").html("CMS内容不能为空");
			return false;
		}
		if(editor.html().length > 65534){
			$("#contentErr").html("CMS内容不能超过65534个字");
			return false;
		}	
		editor.sync();
		$("#updateForm").submit();
	}
</script>
</body>
</html>
